<template>
  <div>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <el-breadcrumb
              separator-class="el-icon-arrow-right"
              style="float: left; display: inline; margin-top: 12px"
            >
              <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
              <el-breadcrumb-item>点检记录</el-breadcrumb-item>
            </el-breadcrumb>
          </div>
          <el-table :data="tableCell" style="width: 100%" center>
            <el-table-column label="日期">
              <template slot-scope="scope">
                <i class="el-icon-time"></i>
                <span style="margin-left: 10px">{{ scope.row.checkTime }}</span>
              </template>
            </el-table-column>
            <el-table-column label="点检人员">
              <template slot-scope="scope">
                <p>{{ scope.row.userName }}</p>
              </template>
            </el-table-column>
            <el-table-column label="类别">
              <template slot-scope="scope">
                <p>{{ scope.row.deviceName }}</p>
              </template>
            </el-table-column>
            <el-table-column label="区域">
              <template slot-scope="scope">
                <p>{{ scope.row.checkName }}</p>
              </template>
            </el-table-column>
            
            <el-table-column label="操作">
              <template slot-scope="scope">
                <!-- <el-button
                  size="mini"
                  type="warning"
                  @click="handleEdit(scope.$index, scope.row)"
                  >编辑</el-button
                >
                <el-button
                  size="mini"
                  type="danger"
                  @click="handleDelete(scope.$index, scope.row)"
                  >删除</el-button
                > -->
                <el-button
                  size="mini"
                  type="primary"
                  @click="handleDetail(scope.$index, scope.row)"
                  >详情</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </el-card>
  </div>
</template>
<script>
import { getCheckInfoList } from "../../api/check";

export default {
  name: "checkLog",
  components: {},
  props: {},
  data() {
    return {
      tableCell: [],
    };
  },
  computed: {},
  watch: {},
  created() {
    this.getCheckList();
  },
  mounted() {},
  methods: {
    getCheckList() {
      getCheckInfoList().then((res) => {
        console.log(res);
        this.tableCell = res.data;
      });
    },
    handleDetail(index,row){
      console.log(row);
      this.$router.push({
        name: "checkLogDetail",
        params: row
      });
    }

  },
};
</script>
<style lang="less" scoped>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}
</style>